package com.gongzuozhan.controller;

import com.gongzuozhan.pojo.BingLi;
import com.gongzuozhan.pojo.GuaHaoJiLu;
import com.gongzuozhan.service.impl.GuaHaoJiLuServiceImpl;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 患者挂号记录(GuaHaoJiLu)表控制层
 *
 * @author Gold
 * @since 2021-03-17 14:59:20
 * @version 1.0
 */
@RestController
@RequestMapping("guaHaoJiLu")
@Api(value = "患者挂号记录(GuaHaoJiLu)管理",tags = "患者挂号记录(GuaHaoJiLu)管理接口API")
@ApiResponses({
        @ApiResponse(code=400,message="请求参数不完整或者错误"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=405,message="请求方式不正确，比如后台接收是post，但前端请求的是get"),
        @ApiResponse(code=406,message="页面地址和接口名冲突"),
        @ApiResponse(code=415,message="请求格式不正确，前端可能没有把请求头修改为json，也可能前端请求的json对象没有转换为字符串"),
        @ApiResponse(code=500,message="后台服务逻辑错误")
})
public class GuaHaoJiLuController {
    /**
     * 服务对象
     */
    @Resource
    private GuaHaoJiLuServiceImpl guaHaoJiLuServiceImpl;

    /**
     * 查询当前日期所有数据
     * @return 返回所有数据
     */
    @GetMapping("chaXunJinRi")
    @ApiOperation(value = "查询今日就诊数据接口",notes = "查询今日就诊数据接口",httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "jiuZhenShiJian",value = "就诊时间",paramType = "query",dataType = "String",required = false),
    })
    public Map<String, Object> chaXunAll(String jiuZhenShiJian
                                       ) {
        return this.guaHaoJiLuServiceImpl.chaXunJinRi(jiuZhenShiJian);
    }




    /**
     * 查询所有数据
     * @return 返回所有数据
     */
    @GetMapping("chaXunQuanBu")
    @ApiOperation(value = "查询所有数据接口",notes = "查询所有数据接口",httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "jiuZhenShiJianQiShi",value = "就诊时间起始",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "jiuZhenShiJianJieShu",value = "就诊时间结束",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "jiuZhenJiLuZhuangTai",value = "就诊记录状态",paramType = "query",dataType = "String",required = false)
    })
    public Map<String, Object> chaXunAll(String jiuZhenShiJianQiShi,
                                          String jiuZhenShiJianJieShu,
                                          String jiuZhenJiLuZhuangTai,
                                         String guaDanDanHao,
                                         String xingMing) {
        return this.guaHaoJiLuServiceImpl.chaXunAll(jiuZhenShiJianQiShi,jiuZhenShiJianJieShu,jiuZhenJiLuZhuangTai,guaDanDanHao,xingMing);
    }

    /**
     * 查询所有数据
     * @return 返回所有数据
     */
    @GetMapping("chaXunHuanZe")
    @ApiOperation(value = "查询单条数据接口",notes = "查询单条数据接口",httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guaHaoDanHao",value = "挂号单号",paramType = "query",dataType = "String",required = false),
    })
    public Map<String, Object> chaXunHuanZe(@RequestParam  String guaHaoDanHao) {
        return this.guaHaoJiLuServiceImpl.chaXunHuanZe(guaHaoDanHao);
    }



    /**
     * 通过主键更新单条数据
     *
     * @return 单条数据
     */
    @RequestMapping(value = "gengXinById", method = RequestMethod.POST)
    @ApiOperation(value = "通过主键更新一个**的接口",notes = "通过主键更新一个**的接口",httpMethod = "POST")
    public Map<String, Object> gengXinById(String guaDanDanHao,Integer jiuZhenJiLuZhuangTai
                                          ) {
        return this.guaHaoJiLuServiceImpl.gengXinById(guaDanDanHao,jiuZhenJiLuZhuangTai);
    }


}